

import fetch from 'common/fetch'
import {port_table} from 'common/port_uri'

//数据列表
export function list(index,params) {
  return fetch({
    url: port_table.list+index,
    method: 'get',
    params
  })
}

//根据id查询频道
export function get(guid) {
  return fetch({
    url: port_table.get+guid,
    method: 'get',
  })
}

//根据id关闭频道
export function close(guid) {
  return fetch({
    url: port_table.close+guid,
    method: 'put'
  })
}
//添加频道
export function add(data) {
  return fetch({
    url: port_table.save,
    method: 'post',
    data
  })
}
//修改频道
export function update(guid,data) {
  return fetch({
    url: port_table.save + guid,
    method: 'put',
    data
  })
}
  //条件查询
export function search(index,size,data) {
  return fetch({
    url: port_table.search + index + '?size=' + size,
    method: 'post',
    data
  })
}

  //变更上下线状态
export function change_online(guid,onlinestatus) {
  return fetch({
    url: port_table.changeonline + guid+ '?onlineStatus=' + onlinestatus,
    method: 'put'
  })
}

